]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
theme: Fixes for oversights in :rtl
authorSam Hewitt <sam@snwh.org>
Wed, 23 Feb 2022 17:45:59 +0000 (14:15 -0330)
committerMarge Bot <marge-bot@gnome.org>
Fri, 4 Mar 2022 13:10:38 +0000 (13:10 +0000)
  - fix padding issue uncovered in #5123
  - fix RTL padding and margin quirks in popovers
  - fix incorrect padding in RTL in message list notifications

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2212>

data/theme/gnome-shell-sass/_common.scss
data/theme/gnome-shell-sass/widgets/_message-list.scss
data/theme/gnome-shell-sass/widgets/_popovers.scss

index af6a05f2bbb5ff5a33824153a1d7ded8189468e7..c6e64766efafc07288a92ed20e389533d4cadf78 100644 (file)
@@ -123,7 +123,9 @@ $bubble_buttons_color: if($variant == 'light', darken($bg_color, 12%), lighten($
 %bubble_button {
   padding: $base_padding * 2;
   font-weight: bold !important;
-  margin-right: 1px;
+
+  &:ltr {margin-right: 1px;}
+  &:rtl {margin-left: 1px;}
 
   @include button(normal, $c:$bubble_buttons_color);
   &:insensitive { @include button(insensitive, $c:$bubble_buttons_color);}
@@ -147,11 +149,12 @@ $bubble_buttons_color: if($variant == 'light', darken($bg_color, 12%), lighten($
 
   &:last-child:rtl {
     border-radius: 0 0 0 $bubble_button_radius;
-    margin-right: 0 !important;
+    margin-left: 0 !important;
   }
 
   &:first-child:last-child {
     border-radius: 0 0 $bubble_button_radius $bubble_button_radius !important;
+    margin-left: 0 !important;
     margin-right: 0 !important;
   }
 }
index 83268cbb3a7f9aaa3a6720d3b11bf7466168df91..7f93e817d7dfdd450be041facd3928edc0953177 100644 (file)
   // icon container
   .message-icon-bin {
     padding: ($base_padding * 3);
-    padding-right:$base_padding;
 
-    &:rtl {
-      padding-right:$base_padding;
-    }
+    &:ltr {padding-right:$base_padding;}
+    &:rtl {padding-left:$base_padding;}
 
     // icon size and color
     > StIcon {
index fd5a02d4cb0ad5b1ea95c9c174377e4fe08a8fa3..08ad324612d632622fc68d7ad9699a2147af38f4 100644 (file)
@@ -2,7 +2,7 @@
 
 // the popover itself
 .popup-menu-boxpointer {
-  margin: $base_margin; // used as distance from the screen edge
+  -arrow-rise: $base_margin+2px; // distance from the panel & screen edge
 }
 
 // container of the popover menu
@@ -12,7 +12,6 @@
 
   //.popup-status-menu-item {font-weight: normal;  color: pink;} //dunno what that is
   &.panel-menu {
-    -boxpointer-gap: $base_margin+2px; // distance from the panel
     margin-bottom: 1.75em; // so it doesn't touch the bottom of the screen
   }
 }
@@ -20,7 +19,6 @@
 // popover content
 .popup-menu-content {
   padding: $base_padding;
-  // account for margin oddities
   border-radius: $modal_radius - 2px;
   border: 1px solid $borders_edge;
   box-shadow: 0 2px 4px 0 rgba(0,0,0,0.1);
 .popup-menu-item {
   padding: $base_padding*1.5 $base_padding*2;
   border-radius: $base_border_radius;
+  spacing: $base_padding;
   transition: 0.2s all ease;
   background-color: transparent;
 
+  &:ltr {padding-left: $base_padding;}
+  &:rtl {padding-right: $base_padding;}
+
   &:focus, &:hover {
    background-color: $hover_bg_color !important;
    &:active { background-color: $active_bg_color !important;}
   }
 
   &:insensitive {color: transparentize($fg_color,0.5);}
+
+  // add margin to switches in menu items
+  .toggle-switch {
+    &:ltr { margin-left: $base_margin;}
+    &:rtl { margin-right: $base_margin;}
+  }
 }
 
 
@@ -71,8 +79,6 @@
 }
 
 .popup-menu-arrow {
-  &:ltr {margin-right: $base_margin;}
-  &:rtl {margin-left: $base_margin;}
 }
 
 
 
   .popup-menu-section {
     .popup-menu-item:last-child {
-      &:hover,&:focus {border-radius: 0;}
+      &:hover,&:focus { border-radius: 0;}
     }
     &:last-child .popup-menu-item:last-child {
       border-radius: 0 0 $base_border_radius $base_border_radius;
   width: 1.2em;
   text-align: center !important;
 
-  &:ltr {text-align: right;};
-  &:rtl {text-align: left;};
+  &:ltr { text-align: right;}
+  &:rtl { text-align: left;}
 }
 
 // separator
 .popup-separator-menu-item {
-  padding:0;
   margin: 6px 0;
+  padding:0 !important;
+  &:ltr { margin-right: $base_margin;}
+  &:rtl { margin-left: $base_margin;}
 
   .popup-separator-menu-item-separator {
     height: 1px; //not really the whole box
     width: 0 !important;
   }
 
+  // separators in submenus
   .popup-sub-menu & {
-    padding: 0;
-    margin-right: 2.5em !important; // account for ornament
     background-color: transparent;
 
+    // account for ornament
+    &:ltr { margin-right: 2.5em;}
+    &:rtl { margin-left: 2.5em;}
+
     .popup-separator-menu-item-separator {
       background-color: lighten($borders_color, 7%);
     }
 
 // desktop background menu
 .background-menu {
-  -boxpointer-gap: $base_margin;
+  -boxpointer-gap: 0px;
   -arrow-rise: 0px; // hide the beak on the menu
 }
 
   // account for ornaments in submenus with padding
   .popup-sub-menu .popup-menu-item > :first-child {
     // this value is hardcoded for visual effect
-    &:ltr { margin-left: $base_margin*2;}
-    &:rtl { margin-right: $base_margin*2;}
+    &:ltr { margin-left: 1em;}
+    &:rtl { margin-right: 1em;}
   }
 }
 
 // right-click (and panel) app menu
 .app-menu {
   max-width: 27.25em;
-  .popup-menu-content { margin: $base_margin;}
-
-  &.panel-menu {
-    .popup-menu-content { margin: 0;} // avoid doubling up margin
-  }
 
   // this is unneeded at the top-level in this menu, hide it
   .popup-menu-ornament { width: 0 !important; }